home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / lib / old-empire.g < prev    next >
Text File  |  1995-05-04  |  4KB  |  227 lines

  1. (game-module "old-empire"
  2.   (title "Old Empire")
  3.   (blurb "An emulation of `old Empire', a distant ancestor of Xconq.")
  4.   ;; No variants were available.
  5. )
  6.  
  7. ;;; Types.
  8.  
  9. (unit-type army (char "A") (image-name "soldiers"))
  10. (unit-type fighter (char "F") (image-name "jets"))
  11. (unit-type destroyer (char "D") (image-name "dd"))
  12. (unit-type submarine (char "S") (image-name "sub"))
  13. (unit-type troop-transport (char "T") (image-name "ap"))
  14. (unit-type cruiser (char "R") (image-name "ca"))
  15. (unit-type carrier (char "C") (image-name "cv"))
  16. (unit-type battleship (char "B") (image-name "bb"))
  17. (unit-type city (char "@") (image-name "city20"))
  18.  
  19. ;;; avgas is used only to constrain fighter range.
  20.  
  21. (material-type avgas)
  22.  
  23. (terrain-type sea (color "sky blue") (char "."))
  24. (terrain-type land (color "green") (char "+"))
  25.  
  26. (define A army)
  27. (define F fighter)
  28. (define D destroyer)
  29. (define S submarine)
  30. (define T troop-transport)
  31. (define R cruiser)
  32. (define C carrier)
  33. (define B battleship)
  34. (define @ city)
  35.  
  36. (define ship (D S T R C B))
  37.  
  38. ;;; Static relationships.
  39.  
  40. (table vanishes-on
  41.   ((A @) sea true)
  42.   (ship land true)
  43.   )
  44.  
  45. ;;; Unit-unit capacities.
  46.  
  47. (table unit-capacity-x
  48.   (T A 6)
  49.   (C F 8)
  50.   )
  51.  
  52. (add @ capacity 100)
  53.  
  54. (table unit-size-as-occupant
  55.   (A @ 50)
  56.   (F @ 1)
  57.   (ship @ 1)
  58.   ;; Cities can't occupy each other.
  59.   (@ @ 200)
  60.   )
  61.  
  62. ;;; Unit-terrain capacity is the default of 1 unit, 1 cell.
  63.  
  64. ;;; Unit-material capacities.
  65.  
  66. (table unit-storage-x
  67.   (F avgas 20)
  68.   ;; Carriers and cities have effectively infinite capacity.
  69.   ((C @) avgas 9999)
  70.   )
  71.  
  72. ;;; Actions.
  73.  
  74. (add (A F) acp-per-turn (1 4))
  75. (add ship acp-per-turn 2)
  76. (add @ acp-per-turn 1)
  77.  
  78. ;;; Movement.
  79.  
  80. (add @ speed 0)
  81.  
  82. (table mp-to-enter-terrain
  83.   (army sea 10)
  84.   (ship land 10)
  85.   )
  86.  
  87. ;4 u* F enter-time
  88.  
  89. (table consumption-per-move
  90.   (F avgas 1)
  91.   )
  92.  
  93. ;;; Construction.
  94.  
  95. (add u* cp (5 10 20 30 25 50 60 75 1))
  96.  
  97. (table acp-to-create
  98.   (@ u* 1)
  99.   (@ @ 0)
  100.   )
  101.  
  102. (table cp-on-creation
  103.   (@ u* 1)
  104.   )
  105.  
  106. (table acp-to-build
  107.   (@ u* 1)
  108.   )
  109.  
  110. (table cp-per-build
  111.   (@ u* 1)
  112.   )
  113.  
  114. (table acp-to-toolup
  115.   (@ u* 1)
  116.   )
  117.  
  118. (table tp-to-build
  119.   (@ u* (1 2 4 6 5 10 12 15 0))
  120.   )
  121.  
  122. (table tp-max
  123.   (@ u* (1 2 4 6 5 10 12 15 0))
  124.   )
  125.  
  126. ;1 ship @ repair
  127.  
  128. ;;; Combat.
  129.  
  130. (add u* hp-max (1 1 3 3 2 8 8 12 1))
  131.  
  132. ;[ 0 0 2 2 1 4 4  6 0 ] u* crippled
  133.  
  134. (table hit-chance
  135.   (u* u* 50)
  136.   ;; Cities don't participate in combat.
  137.   (u* @ 0)
  138.   (@ u* 0)
  139.   ;; except vs armies.
  140.   (A @ 50)
  141.   (@ A 50)
  142.   )
  143.  
  144. (table damage
  145.   (u* u* 1)
  146.   ;; Subs hit ships harder.
  147.   (S ship 3)
  148.   ;; Armies don't damage cities.
  149.   (A @ 0)
  150.   )
  151.  
  152. (table capture-chance
  153.   (A @ 50)
  154.   )
  155.  
  156. (table hp-to-garrison
  157.   ;; Use up the capturing army.
  158.   (A @ 1)
  159.   )
  160.  
  161. ;"shoots down" F destroy-message
  162. ;"sinks" ship destroy-message
  163. ;"runs out of fuel and crashes" F starve-message
  164.  
  165. ;;; Backdrop.
  166.  
  167. (table base-consumption
  168.   (F avgas 4)
  169.   )
  170.  
  171. (table base-production
  172.   ((C @) avgas 9999)
  173.   )
  174.  
  175. (table hp-per-starve
  176.   (F avgas 1.00)
  177.   )
  178.  
  179. ;;; Scoring.
  180.  
  181. (add u* point-value 0)
  182. (add @ point-value 1)
  183.  
  184. (scorekeeper (do last-side-wins))
  185.  
  186. ;;; Random setup.
  187.  
  188. (add t* alt-percentile-min (0 70))
  189. (add t* alt-percentile-max (70 100))
  190. (add t* wet-percentile-min 0)
  191. (add t* wet-percentile-max 100)
  192.  
  193. (set country-radius-min 3)
  194.  
  195. (set country-separation-min 15)
  196.  
  197. (add t* country-terrain-min (2 1))
  198.  
  199. (add city start-with 1)
  200. (add city independent-near-start 3)
  201.  
  202. (table favored-terrain
  203.   (city (sea land) (0 100))
  204.   )
  205.  
  206. (table independent-density
  207.   (city land 200)
  208.   )
  209.  
  210. (table unit-initial-supply
  211.   (@ avgas 9999)
  212.   )
  213.  
  214. (game-module (notes (
  215.   "Of course, this will not be exactly like old Empire - for one thing, Xconq maps"
  216.   "are composed of hexes and not squares!  However, we can reproduce the details"
  217.   "of the playing pieces fairly well."
  218.   ""
  219.   "The chief defects are that combat is always mutual, rather than"
  220.   "one-side-at-a-time hits, and that cities must have capacity for armies."
  221.   "In the latter case, this period fixes an annoying defect of the original"
  222.   "empire game!  Also, some of the messages are a little weird."
  223.   ""
  224.   "There is also an imbalance in that ships defeating armies don't run"
  225.   "aground, so they are more useful than in the original."
  226. )))
  227.